package com.bjnet.game.util;


import android.content.Context;
import android.content.SharedPreferences;

import com.bjnet.game.R;
import com.bjnet.game.ScreenRenderApp;

public class SharedPreferenceHelper {

    public Context context;
    private SharedPreferences sharedPreferences;
    private SharedPreferences.Editor editor;

    public static SharedPreferenceHelper getInstance() {
        return SingletonHolder.INSTANCE;
    }
    private static class SingletonHolder {
        private static final SharedPreferenceHelper INSTANCE = new SharedPreferenceHelper();
    }
    private SharedPreferenceHelper() {
        context = ScreenRenderApp.getContext();
        sharedPreferences = context.getSharedPreferences(context.getResources().getString(R.string.file), Context.MODE_PRIVATE);
        editor = sharedPreferences.edit();
    }

    private static final String Have_an_account = "我的账号";

    public void setHave_an_account(boolean having){
        editor.putBoolean(Have_an_account,having);
        editor.apply();
    }

    public boolean getHave_an_account(){
        return sharedPreferences.getBoolean(Have_an_account,false);
    }
//    private static final String VIDEO_WALLPAPER_PLAYING = "video_wallpaper_playing";

    /*public void setVideoPlayList(String newVideoWallpaperList) {
        editor.putString(VIDEO_WALLPAPER_PLAYING,newVideoWallpaperList);
        editor.commit();
    }
    public String getVideoPlayList() {
        return sharedPreferences.getString(VIDEO_WALLPAPER_PLAYING,"[]");
    }*/
}
